using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class XmlDataSourceXsltPage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        GridView gridView;
        gridView = new GridView();
        this.form1.Controls.Add(gridView);
        ShowBooks(gridView);
    }

    void ShowBooks(GridView gridView)
    {

        XmlDataSource xmlDataSource
        = new XmlDataSource();
        xmlDataSource.DataFile =
        Server.MapPath(".") + "\\Books.xml";
        xmlDataSource.GetXmlDocument();
        xmlDataSource.TransformFile = 
        Server.MapPath(".") + "\\Books.xsl";
        gridView.DataSource = xmlDataSource;
        gridView.DataBind();

    }
}
